export default {
    data () {
        return {
            title: '前台错误监控系统',
            formData: {
                userName: "",
                password: ""
            },
            heightObj: '0'
        }
    },

    methods: {
        init () {
            this.getHeight();
        },

        /**
         * 登录
         * 
        */
        login () {
            const that = this;
            if(this.formData.userName && this.formData.password){
                this.$axios.post('/api/login', this.formData).then((json)=>{
                    if(json.data.success){
                        window.location.href = "/"
                    }else{
                        alert(json.data.msg);
                    }
                })
            }else{
                alert('请将登录信息填写完整');
            }

        },

        /**
         * 获取页面高度
        */
        getHeight () {
            const Dom = document.documentElement.clientHeight;
            console.log(Dom)
            this.heightObj = Dom + 'px';
        }
    },
    mounted () {
        this.init();
        console.log()
    }
}